package com.example.springboot3demo.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.springboot3demo.entity.BondAccessRecord;
import com.example.springboot3demo.service.BondAccessRecordService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/bondAccessRecord")
@Tag(name = "BondAccessRecord管理", description = "BondAccessRecord相关接口")
public class BondAccessRecordController {

    @Autowired
    private BondAccessRecordService bondAccessRecordService;

    /**
     * 分页查询 bond_access_record 记录
     */
    @GetMapping("/list")
    @Operation(summary = "分页查询BondAccessRecord记录", description = "分页查询bond_access_record表的记录")
    @ApiOperationSupport(order = 1)
    public IPage<BondAccessRecord> list(
            @Parameter(description = "页码", example = "1") @RequestParam(defaultValue = "1") int pageNum,
            @Parameter(description = "每页数量", example = "10") @RequestParam(defaultValue = "10") int pageSize
    ) {
        Page<BondAccessRecord> page = new Page<>(pageNum, pageSize);
        return bondAccessRecordService.page(page);
    }

}